workspace "bittorrent"
	location "prj"
	configurations {"Debug", "Release"}
	warnings "Extra"
	files {"src/**.h", "src/**cpp"}
	
	filter "configurations:Debug"
    	defines { "DEBUG" }
    filter{}

    filter "configurations:Release"
   		defines { "NDEBUG" }
   	filter{}

	filter {"action:vs*", "kind:SharedLib or ConsoleApp"}
		linkoptions "/DEBUG"
	filter{}

	filter {"action:vs*", "configurations:Release"}
		optimize "On"
	filter{}


project "bittorrent"
	kind "StaticLib"
	language "c++"

project "test"
	includedirs {"src"}
	kind "ConsoleApp"
	language "c++"
	targetdir "bin/%{cfg.buildcfg}"
	files {"test/**.h", "test/**.hpp", "test/**.cpp"}

	test_torrent_files = os.matchdirs "test/torrents"
	if #test_torrent_files == 1 then
		p = path.getabsolute(test_torrent_files[1])
		postbuildcommands "{COPY} %{p} %{cfg.targetdir}"
	end